package Anlimal;

public class Test {
    public static void main(String[] args) {
        Dog d = new Dog();
        System.out.println(d.life+"  "+d.weight);
        d.eat();

    }
}

class Animal{
    public int life;
    public int weight;

    public Animal(int life,int weight){
        this.life = life;
        this.weight = weight;
    }
    public void eat(){
        System.out.println("吃东西");
    }

}

class Dog extends Animal{
    public Dog() {
        super(8, 16);
    }


    public void eat(){
        System.out.println("吃骨头");
        super.eat();
    }
}

class Cat extends Animal{
    public Cat(){
        super(9,3);
    }
}

